<div>
    <fieldset>
        <legend>Типы изданий</legend>
            <?php echo $this->EditTypes()->ToHtml(); ?>

        <div class="PageMenu">
            <input type="button" id="AddEditType" value="Добавить тип"/>
            <input type="button" id="AltEditType" value="Изменить"/>
        </div>

    </fieldset>

    <script type="text/javascript">
        jsun.run(function() {
        //////////////////////////////////////////////////////

        jsun("#AddEditType").jsun.event({ onclick: AddType });
        jsun("#AltEditType").jsun.event({ onclick: AltType });

        function AddType() {
            var dlg = new jsun.dialog({ title: 'Новый тип' });
            jsun.html.insert(dlg.content.v, jsun.html.sync_load("u=Lib&m=Lib\\EditType/Add"));
            return dlg.show();
        }

        function AltType() {
            var dlg = new jsun.dialog({ title: 'Изменить тип' });
            jsun.html.insert(dlg.content.v, jsun.html.sync_load("u=Lib&m=Lib\\EditType/Alt&id="
                + jsun("#EditTypeList").value));
            return dlg.show();
        }

        ///////////////////////////////////////////////////////
        });
    </script>
</div>